<%= error_messages_for 'reader' %>

<p>
<%if @reader.pic_url&&!@reader.pic_url.empty?%>
<%= image_tag(@reader.pic_url , :size => "64x64")%>
<%else%>
<%= image_tag('default_head.gif', :size => "64x64")%>
<%end%>
<a href="#" onclick="collapseNochange('changePicture'); return false;">更改头像</a></p>

<div id="changePicture" style="DISPLAY: none">
<p><label for="pic_url">图片链接:</label><br/>
<%=text_field('reader','pic_url')%>
</p>
</div>

<p><label for="login_name">登录名:</label><br/>
<%= text_field 'reader', 'login_name'  %></p>

<p><label for="reader_name">姓名:</label><br/>
<%= text_field 'reader', 'reader_name'  %></p>

<p><label for="email">email:</label><br/>
<%= text_field 'reader', 'email'  %></p>

<p><label for="department">部门:</label><br/>
<%if @departments != nil %>
<%= collection_select 'reader', 'department_id' , @departments, :id , :name%>
<%else%>
    <%= text_field 'reader', 'department_id', :value=>@reader.department.name  %>
<%end%>
</p>

<p><label for="email">密码:</label><br/>
<%=password_field('reader','password',:onfocus=>"collapseNochange('confirm');$(reader_password_confirmation).value='';return false;")%></p>


<p id="confirm" style="display: none"><label for="email">密码确认:</label><br/>
<%= password_field ('reader', 'password_confirmation' , :value=>@reader.password)%></p>

<%= hidden_field 'reader', 'is_admin'%></p>